<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Sys_Menu extends Model
{
    use HasFactory;
    /**
     * 关联到模型的数据表
     *
     * @var string
     */
    protected $table = 'sys_menu';

    public $timestamps = false;

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    protected $fillable = [
        'mec_type',
        'parent_id',
        'menu_name',
        'menu_key',
        'menu_icon',
        'component',
        'menu_route',
        'menu_sort',
        'is_menu',
        'active_menu'
    ];

    public function scopeisShow($query)
    {
        return $query->where('is_menu', 'Y');
    }

}
